#pragma once
#include "vrrwidget.h"

class VPicture :
    public VRRWidget
{
public:
    VPicture(void);

    VPicture(const std::string& imgpth, int x = 0, int y = 0, int w = 50, int h = 50);

    virtual ~VPicture(void);

public:
    virtual bool render() const;

public:
    virtual bool loadTexture(const std::string& imgpth);
    virtual GLuint getTexture(void) const;

public:
    virtual GLuint detach();
    virtual void attach(GLuint tex);

public:
    virtual void renderAnother(const VPicture& anopic) const;

    virtual bool isLoaded() const;

protected:  // 单件
    VPicture(const VPicture&);
    VPicture& operator=(const VPicture&);

protected:

    // convert SDL surface to OpenGL texture


protected:
    GLuint _texture;
    bool _loaded;
};
